import request from '../../utils/request';

// 专家服务管理相关 API

// 更新专家服务
export const updateExpertService = (data: any) => {
    return request({
        url: '/product/api/expert-service',
        method: 'put',
        data
    });
};

// 创建专家服务
export const createExpertService = (data: any) => {
    return request({
        url: '/product/api/expert-service',
        method: 'post',
        data
    });
};

// 查询专家服务详情
export const getExpertServiceDetail = (id: string) => {
    return request({
        url: `/product/api/expert-service/${id}`,
        method: 'get'
    });
};

// 删除专家服务
export const deleteExpertService = (id: string) => {
    return request({
        url: `/product/api/expert-service/${id}`,
        method: 'delete'
    });
};

// 更新专家服务排序
export const updateExpertServiceSortOrder = (id: string, data: any) => {
    return request({
        url: `/product/api/expert-service/${id}/sort-order`,
        method: 'put',
        data
    });
};

// 更新专家服务状态
export const updateExpertServiceStatus = (id: string, data: any) => {
    return request({
        url: `/product/api/expert-service/${id}/status`,
        method: 'put',
        data
    });
};

// 审核专家服务通过
export const approveExpertService = (serviceId: string, data?: any) => {
    return request({
        url: `/product/api/expert-service/${serviceId}/approve`,
        method: 'post',
        data
    });
};

// 审核专家服务拒绝
export const rejectExpertService = (serviceId: string, data?: any) => {
    return request({
        url: `/product/api/expert-service/${serviceId}/reject`,
        method: 'post',
        data
    });
};

// 提交专家服务审核
export const submitExpertServiceApproval = (serviceId: string, data?: any) => {
    return request({
        url: `/product/api/expert-service/${serviceId}/submit-approval`,
        method: 'post',
        data
    });
};

// 分页查询专家服务
export const getExpertServicePage = (params: any) => {
    return request({
        url: '/product/api/expert-service/page',
        method: 'get',
        params
    });
};
